package com.bwie.common.remote.system.factory;

import com.bwie.common.domain.User;
import com.bwie.common.remote.system.RemoteUserService;
import com.bwie.common.result.Result;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;

/**
 * @Author：ShenJiaFeng
 * @Package：com.bwie.common.remote.system.factory
 * @Project：zg6_yuekao
 * @name：RemoteUserFactory
 * @Date：2024/5/17 9:56
 */
@Component
public class RemoteUserFactory implements FallbackFactory<RemoteUserService> {
    @Override
    public RemoteUserService create(Throwable cause) {
        return new RemoteUserService() {
            @Override
            public Result<User> findByPhone(String phone) {
                return Result.error("远程调用失败"+phone);
            }
        };
    }
}
